// vuex数据类型
// 固定数据类型
export interface Commit {
    (mutationName: string, val: any): void
}
export interface ActionsFunctionContext {
    state: Object,
    rootState: Object,
    commit: Commit,
    dispatch: any,
    getters: Object
}

// 自己项目的数据类型
export interface StateType {
    user: UserStateType,
    category: CategoryStateType,
    cart: any,
}

export interface ActionsFunctionType {
    (context: ActionsFunctionContext, val: Object): void
}

export interface UserStateType {
    profile: {
        id: string
        avatar: string
        nickName: string
        account: string
        mobile: string
        token: string
    }
}

export interface CategoryListGoods {
    id: string,
    name: string,
    desc: string,
    picture: string,
    price: string
}

export interface CategoryListItem {
    id: string,
    name: string,
    picture?: string,
    children?: CategoryListItem[],
    goods?: CategoryListGoods[]
}

export interface CategoryStateType {
    list: CategoryListItem[],
    showMenuId: string
}